<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head> 
        <link rel = "stylesheet" type = "text/css" href = "css/default.css"/>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
        <LINK rel="shortcut icon" href="imagens/favicon.png"/>
        <title>JBS DirfWeb</title>
    </h:head>
    <f:view encoding="ISO-8859-1" contentType="text/html">
        <h:body style="background-image: url(imagens/fndJBS_.jpg)">

            <div style="margin: 3%;">
                
                <h:panelGrid style="width: 100%" columns="2">
                    
                    <h:panelGroup>
                        <img src="imagens/logo380.png" />
                    </h:panelGroup>
                    
                    <h:panelGroup >
                        <img src="imagens/logoDIRF.png" align="right"/>
                    </h:panelGroup>
                    
                </h:panelGrid>
                
            </div>

            <h:form id="formAcesso" >

                <p:dialog modal="true" 
                          widgetVar="statusDialog" 
                          header="Aguarde..." 
                          draggable="false" 
                          closable="false" 
                          resizable="false" >
                    
                    <p:graphicImage value="/imagens/ajaxloadingbar.gif" />
                    
                </p:dialog>

                <p:growl id="mensagens" showDetail="true"/>

                <div align="center" style="margin: 5%; ">

                    <p:panel style="width: 200px;" 
                             header="&nbsp;&nbsp;&nbsp;&nbsp;A C E S S O">
                        
                        <hr/>
                        
                        <p:fieldset>
                            <h:panelGrid columns="2" >
                                <h:outputText value="Documento [CPF]" /><br/>
                                <p:inputText value="#{acessoMB.beneficiario.documento}" 
                                             style="width: 97%;" />
                            </h:panelGrid>
                        </p:fieldset>
                        
                        <hr/>
                        
                        <p:commandButton value="entrar" 
                                         action="#{acessoMB.acessar()}" 
                                         update="formAcesso" 
                                         onclick="statusDialog.show()" 
                                         oncomplete="statusDialog.hide()" />
                        
                        <p:commandButton value="administra&ccedil;&atilde;o" 
                                         update=":dialogLogin" 
                                         oncomplete="PF('dlgLogin').show();" />
                    </p:panel>

                </div>

                <p:hotkey bind="ctrl+shift+l"
                          update=":dialogLogin" 
                          oncomplete="dlgLogin.show()" />

            </h:form>

            <p:dialog id="dialogLogin" 
                      header="Login administrativo" 
                      widgetVar="dlgLogin" 
                      appendTo="@(body)"
                      modal="true">

                <h:form id="formLogin" >

                    <h:panelGrid columns="1" 
                                 style="width: 200px; height: 100px" > 

                        <h:panelGroup>
                            <h:outputText value="Login" /><br/>
                            <p:inputText value="#{acessoMB.administrador.login}" 
                                         style="width: 97%;"/>
                        </h:panelGroup>

                        <h:panelGroup>
                            <h:outputText value="Senha" /><br/>
                            <p:password value="#{acessoMB.administrador.senha}" 
                                        style="width: 97%;"/>
                        </h:panelGroup>

                        <p:commandButton value="entrar" 
                                         action="#{acessoMB.loginADM()}"
                                         ajax="false"/>
                    </h:panelGrid>

                </h:form>

            </p:dialog>

        </h:body>

    </f:view>

</html>

